﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Data.OleDb;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

namespace skvote
{
    public partial class config : System.Web.UI.Page
    {
        private OleDbConnection connection = new conn().CreateConnection();
        private string username =  "",password = "",webName = "",webUrl="",SystemUrl="";
        private bool restrictIP,allowView,userInfo;
        private int refuseTime;
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        public config()
        {
            try
            {
                OleDbCommand cmd = new OleDbCommand("SELECT * FROM XH_Config", connection);
                OleDbDataReader dr = cmd.ExecuteReader();
                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        username = dr.GetString(0);
                        password = dr.GetString(1);
                        webName = dr.GetString(2);
                        webUrl = dr.GetString(3);
                        SystemUrl = dr.GetString(4);
                        restrictIP = dr.GetBoolean(5);
                        allowView = dr.GetBoolean(6);
                        refuseTime = dr.GetInt32(7);
                        userInfo = dr.GetBoolean(8);
                    }
                }
            }
            finally
            {
                connection.Close();
            }
        }
        public string getUsername()
        {
            return username;
        }
        public string getPassword()
        {
            return password;
        }
        public string getWebName()
        {
            return webName;
        }
        public string getWebUrl()
        {
            return webUrl;
        }
        public string getSystemUrl()
        {
            return SystemUrl;
        }
        public bool getRestrictIP()
        {
            return restrictIP;
        }
        public bool getAllowView()
        {
            return allowView;
        }
        public int getRefuseTime()
        {
            return refuseTime;
        }
        public bool getUserInfo()
        {
            return userInfo;
        }
    }
}
